/*
 * Teacher.cpp
 *
 *  Created on: 13 May 2010
 *      Author: Savramis Sartios
 */

#include "Teacher.h"

#include "../../Validators/TeacherValidators/TeacherEntityValidator/TeacherEntityValidator.h"

Teacher::Teacher(const string *code,const string *name,const string *lastName){
	if((0!=code)&&(0!=name)&&(0!=lastName)){
		setCode(code);
		setName(name);
		setLastName(lastName);
	}
}
Teacher::Teacher() {
	this->code_=0;
	this->lastName_=0;
	this->name_=0;

}

Teacher::Teacher(const ITeacher *teacher){
	if(0!=teacher){
		TeacherEntityValidator teacherValidator;
		if(teacherValidator.ownerIsCorrect(teacher)){
			setCode(teacher->getCode());
			setName(teacher->getName());
			setLastName(teacher->getLastName());
		}
	}
}
Teacher::~Teacher() {
	// TODO Auto-generated destructor stub
}

bool	Teacher::setName(const string *name){
	if(0!=name){
		name_ = const_cast<string*>(name);
		return true;
	}
	//throw;
}

string	*	Teacher::getName()const{
	if(0!=name_){
		return name_;
	}
	//throw;
}

bool		Teacher::setLastName(const string *lastName){
	if(0!=lastName){
		lastName_= const_cast<string*>(lastName);
		return true;
	}
	//throw;
}

string	*	Teacher::getLastName()const{
	if(0!=lastName_){
		return lastName_;
	}
	//throw;
}

bool	Teacher::setCode(const string *code){
	if(0!=code){

		code_=const_cast<string*>(code);
		return true;
	}
	//throw;
}

string	*	Teacher::getCode()const{
	if(0!=code_){
		return code_;
	}
	//throw 0;
}
